package cn.itsource.feign;

import cn.itsource.feign.fallback.LogisticFeignClientFallbackFactory;
import cn.itsource.pojo.Logistic;
import cn.itsource.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "logistic-server" ,fallbackFactory = LogisticFeignClientFallbackFactory.class)
public interface LogisticFeignClient {
    @GetMapping("/logistic/orderid/{oid}")
    Logistic queryBySn(@PathVariable Integer oid);

    @GetMapping("/logistic/{id}")
    Logistic queryById(@PathVariable Integer id);

    @PutMapping("/logistic")
    AjaxResult saveOrUpdate(@RequestBody Logistic logistic);
}
